﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using XXX.Models.XXXEntities;
using XXX.Bo;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace XXX.api.Controllers
{

    [Route("api/wms/[controller]")]
    [ApiController]
    //[Authorize]
    public class SA_GetDispatchlistController : ControllerBase
    {
        //private readonly IKuCunReqRepository _invRepository;
        private readonly ILogger<SA_GetDispatchlistController> _logger;
        public SA_GetDispatchlistController(ILogger<SA_GetDispatchlistController> logger)
        {
            //_invRepository = xxxRepository;
            _logger = logger;
        }

        /// <summary>
        /// ccode =0，代表全部
        /// </summary>
        /// <param name="ccode">单据号</param>
        /// <param name="cwhcode">仓库编码</param>
        /// <returns></returns>
        [HttpGet]
        public Models.RetModel Get(string corg,string ccode,string cwhcode)
        {
            Models.RetModel ret = DBService.SA_GetDispatchlist(corg,ccode, cwhcode);
            return ret;
            //return ReturnStd.Success(jsonstr);
        }

    }

    [Route("api/wms/[controller]")]
    [ApiController]
    //[Authorize]
    public class SA_GetDispatchlist2Controller : ControllerBase
    {
        //private readonly IKuCunReqRepository _invRepository;
        private readonly ILogger<SA_GetDispatchlist2Controller> _logger;
        public SA_GetDispatchlist2Controller(ILogger<SA_GetDispatchlist2Controller> logger)
        {
            //_invRepository = xxxRepository;
            _logger = logger;
        }

        /// <summary>
        /// ccode =0，代表全部
        /// </summary>
        /// <param name="ccode">单据号</param>
        /// <param name="cwhcode">仓库编码</param>
        /// <returns></returns>
        [HttpGet]
        public Models.RetModel Get(string corg, string ccode, string cwhcode)
        {
            Models.RetModel ret = DBService.SA_GetDispatchlist2(corg,ccode, cwhcode);
            return ret;
            //return ReturnStd.Success(jsonstr);
        }

    }

    [Route("api/wms/[controller]")]
    [ApiController]
    //[Authorize]
    public class SA_DispToRd32Controller : ControllerBase
    {
        //private readonly IKuCunReqRepository _invRepository;
        private readonly ILogger<SA_DispToRd32Controller> _logger;
        public SA_DispToRd32Controller(ILogger<SA_DispToRd32Controller> logger)
        {
            //_invRepository = xxxRepository;
            _logger = logger;
        }

        [HttpPost]
        public Models.RetModelbool Post(ScanBarcodeSA model)
        {
            Models.RetModelbool ret = WMSService.SA_DispToRd32(model);
            return ret;
            //return ReturnStd.Success(jsonstr);
        }
    }
   

    

     

}
